//


#import "NT_LeftTableViewCell.h"

@implementation NT_LeftTableViewCell

// 初始化cell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self createTableViewCell];
    }
    return self;
}

// 初始化
-(void)createTableViewCell {
    //
    self.img = ({
        UIImageView *img = [[UIImageView alloc]init];
        [self.contentView addSubview:img];
        img;
    });
    //
    self.titleLabel = ({
        UILabel *label = [[UILabel alloc]init];
        label.textColor = rgba(90, 90, 90, 1);
        label.font = FontPFRegular(kRelativeWidth(15));
        label.text = @"";
        [self.contentView addSubview:label];
        label;
    });
    //
    self.numLabel = ({
        UILabel *label = [[UILabel alloc]init];
        label.textColor = rgba(90, 90, 90, 1);
        label.font = FontPFRegular(kRelativeWidth(15));
        label.text = @"";
        [self.contentView addSubview:label];
        label;
    });
    
}

- (void)setNeedsLayout {
    [super setNeedsLayout];
    
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(10));
        make.left.mas_offset(kRelativeWidth(12));
        make.width.height.mas_equalTo(kRelativeHeight(20));
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(10));
        make.left.mas_equalTo(self.img.mas_right).offset(kRelativeWidth(10));
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
    [self.numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_offset(kRelativeHeight(10));
        make.right.mas_offset(-kRelativeWidth(12));
        make.height.mas_equalTo(kRelativeHeight(20));
    }];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
